<?php

/**
 * StaffPubOrganization form base class.
 *
 * @method StaffPubOrganization getObject() Returns the current form's model object
 *
 * @package    erp-dnict
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseStaffPubOrganizationForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'staff_id'            => new sfWidgetFormInputHidden(),
      'pub_organization_id' => new sfWidgetFormInputHidden(),
      'start_date'          => new sfWidgetFormDate(),
      'position'            => new sfWidgetFormInputText(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'staff_id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('staff_id')), 'empty_value' => $this->getObject()->get('staff_id'), 'required' => false)),
      'pub_organization_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('pub_organization_id')), 'empty_value' => $this->getObject()->get('pub_organization_id'), 'required' => false)),
      'start_date'          => new sfValidatorDate(),
      'position'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'          => new sfValidatorDateTime(),
      'updated_at'          => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('staff_pub_organization[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'StaffPubOrganization';
  }

}
